home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d1 / epromdeo.arc / 7C331.PLD < prev    next >
Text File  |  1989-04-22  |  2KB  |  106 lines

  1. Sample file for the 7C331   Use with the SMS PLDASM version 3.0e or later
  2.  
  3. this implements an asynchronous counter, with additional outputs to
  4. test inversion and combinatorial logic
  5.  
  6. Device 7c331
  7.  
  8.  pin1    = 1
  9.  pin2    = 2
  10.  pin3    = 3
  11.  pin4    = 4
  12.  pin5    = 5
  13.  pin6    = 6
  14.  pin7    = 7
  15.  pin9    = 9
  16.  pin10   = 10
  17.  pin11    = 11
  18.  pin12    = 12
  19.  pin13    = 13
  20.  pin14    = 14
  21. /pin15    = 15
  22. /pin16    = 16
  23. /pin17    = 17
  24. /pin18    = 18
  25. /pin19    = 19
  26. /pin20    = 20
  27. /pin23    = 23
  28. /pin24    = 24
  29. /pin25    = 25
  30. /pin26    = 26
  31. /pin27    = 27
  32. /pin28    = 28
  33.  iff15    = 29    ' represents the Q of input flip flops pins 15..28
  34.  iff16    = 30
  35.  iff17    = 31
  36.  iff18    = 32
  37.  iff19    = 33
  38.  iff20    = 34
  39.  iff23    = 35
  40.  iff24    = 36
  41.  iff25    = 37
  42.  iff26    = 38
  43.  iff27    = 39
  44.  iff28    = 40
  45.  
  46. start
  47.  
  48. ' store the set and reset lines on the neg clock of pin 5
  49. iff15     := ;   ' preset, pin 15 as input clocked by pin 1
  50. iff15.iclk = pin1;
  51.  
  52. iff16     := ;   ' reset
  53. iff16.iclk = pin1;
  54.  
  55. '/pin15    /= pin7;  ' if both these lines are included,
  56. /pin16    /= pin9;  ' then there will be an error reported,
  57.                      ' the 7C331 shared mux allows 3 / 4 feedbacks
  58.  
  59. ' three bit synchronous counter with pin4 as async preset and pin 2 as
  60. ' sync reset.  Pin 1 is the sync clock.
  61.  
  62. /pin28   /:= /pin2 *  pin28    ' hold
  63.            +  pin2 * /pin28;   ' count
  64. /pin28.clk =  pin1;
  65. /pin28.set = /iff15;
  66. /pin28.rst = /iff16;
  67.  
  68. /pin27   /:=  pin2 *  pin28     ' count
  69.            ^  pin27;        ' one method to use XOR
  70. /pin27.clk =  pin1 ;
  71. /pin27.set = /iff15;
  72. /pin27.rst = /iff16;
  73.  
  74. /pin26   /:=  pin2 *  pin27 * pin28;
  75. /pin26.xor =  pin26;  ' another method to use XOR
  76. /pin26.clk =  pin1 ;
  77. /pin26.set = /iff15;
  78. /pin26.rst = /iff16;
  79.  
  80. /pin20    /=  pin28* pin27* pin26;  'carry output
  81.  
  82. ' three bit async ripple counter. Pin 3 is the clock. Pin 2 is async
  83. ' reset, pin 4 is async preset.  Output enable is pin 6.
  84.  
  85. /pin25   /:= /pin25;         ' D == Q
  86. /pin25.clk =  pin3 ;
  87. /pin25.rst = /pin2 ;
  88. /pin25.set = /pin4 ;
  89. /pin25.ena = /pin14;
  90.  
  91. /pin24   /:= /pin24;
  92. /pin24.clk = /pin25;
  93. /pin24.rst = /pin2 ;
  94. /pin24.set = /pin4 ;
  95. /pin24.ena = /pin14;
  96.  
  97. /pin23   /:= /pin23;
  98. /pin23.clk = /pin24;
  99. /pin23.rst = /pin2 ;
  100. /pin23.set = /pin4 ;
  101. /pin23.ena = /pin14;
  102.  
  103. /pin19    /= pin23 *pin24 *pin25;
  104.  
  105. end;
  106.